package com.qh.oa;

import java.util.HashMap;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.qh.R;
import com.qh.util.CategoryThread;
import com.qh.util.HttpGlobal;

public class MainActivity extends Activity {
	private Context context;
	public Handler handler;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		this.context = this;
		handler = new Handler() {
			@Override
			public void handleMessage(Message msg) {
				System.out.println("进入handler");
				String type = msg.getData().getString("type");
				String result = msg.getData().getString("data");
				System.out.println("result...." + result);
				System.out.println("type..." + type);
			}

		};
		stratAppThread("7","","","1","20");
		
	}
	public void stratAppThread(String bigCategoryId,String smallCategoryId,String keyword,String currentPage,String pageNum)
	{
		//起线程获取　大类应用程序的所有子类信息
		 HashMap<String, String> params=new  HashMap<String, String>();
		 params.put("bigCategoryId", bigCategoryId);
		 params.put("smallCategoryId",smallCategoryId);
		 params.put("keyword",keyword);
		 params.put("currentPage",currentPage);
		 params.put("pageNum", pageNum);
		 String url=HttpGlobal.serviceUrl+"getAppList.action";
		 CategoryThread  getCategoryThread=new CategoryThread(handler,url,params,"app");
		 getCategoryThread.start();

	}
}